package cn.keduox.entity;

import cn.keduox.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * 书籍二级类型
 */
@Table(name = "second_type")
public class SecondType {
    /**
     * id
     */
    @Id(name = "id")
    @Column(name = "id")
    private String id;
    /**
     * 名称
     */
    @Column(name = "name")
    private String name;
    /**
     * 所属父类型id
     */
    @Column(name = "sub_type_id")
    @Key(farther = "second_type")
    private String subTypeId;
    /**
     * 所属父类型
     */
    private SubType subType;
    /**
     *删除标记，0正常，1删除
     */
    @Column(name = "del_flag")
    private Integer deleteFlag;
    /**
     * 与书本信息关联
     */
    @Entity(table = "book",field = "id",address = "cn.keduox.entity.Book",name = "bookList")
    List<Book> bookList=new ArrayList<>();

    public List<Book> getBookList() {
        return bookList;
    }

    public void setBookList(List<Book> bookList) {
        this.bookList = bookList;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public SecondType() {
    }

    public SecondType(String id, String name, String subTypeId) {
        this.id = id;
        this.name = name;
        this.subTypeId = subTypeId;
    }

    public SecondType(String id, String name, String subTypeId, SubType subType) {
        this.id = id;
        this.name = name;
        this.subTypeId = subTypeId;
        this.subType = subType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSubTypeId() {
        return subTypeId;
    }

    public void setSubTypeId(String subTypeId) {
        this.subTypeId = subTypeId;
    }

    public SubType getSubType() {
        return subType;
    }

    public void setSubType(SubType subType) {
        this.subType = subType;
    }


}
